import VueRouter from "vue-router";

//引入组件
import Home from '../pages/home.vue'
import Nav1 from '../pages/nav1.vue'
import Nav2 from '../pages/nav2.vue'
import Nav3 from '../pages/nav3.vue'
import Nav4 from '../pages/nav4.vue'
import Nav5 from '../pages/nav5.vue'
import Nav2Nav1 from '../pages/nav2nav1.vue'
import Nav2Nav2 from '../pages/nav2nav2.vue'
import Nav2Nav3 from '../pages/nav2nav3.vue'
import Nav2Nav4 from '../pages/nav2nav4.vue'
import Nav2Nav5 from '../pages/nav2nav5.vue'
//创建路由器
export default new VueRouter({
    routes:[
        {
            path:'/',
            redirect:'/home'
        },
        {
            path:'/home',
            component:Home
        },
        {
            path:'/nav1',
            component:Nav1
        },
        {
            path:'/nav2',//资源
            component:Nav2,
            children:[
                {
                    path:'/nav2nav1',
                    component:Nav2Nav1
                },
                {
                    path:'/nav2nav2',
                    component:Nav2Nav2
                },
                {
                    path:'/nav2nav3',
                    component:Nav2Nav3
                },
                {
                    path:'/nav2nav4',
                    component:Nav2Nav4
                },
                {
                    path:'/nav2nav5',
                    component:Nav2Nav5
                }
            ]
        },
        {
            path:'/nav3',
            component:Nav3
        },
        {
            path:'/nav4',
            component:Nav4
        },
        {
            path:'/nav5',
            component:Nav5
        },
    ]
})